import React from "react";
import style from "./style.module.scss";

interface propsType {
  menuIndex: number;
  menuUrl: string;
  menuText: string;
  onNavigate: (index: number) => void;
}

export const MenuItem: React.FC<propsType> = ({
  menuIndex,
  menuUrl,
  menuText,
  onNavigate,
}) => {
  return (
    <div className={style.menu_item} onClick={() => onNavigate(menuIndex)}>
      <img src={menuUrl} alt="" className={style.item_img} />
      <div className={style.item_title}>{menuText}</div>
    </div>
  );
};

export default MenuItem;
